#-*-coding:utf-8-*-
import hou
class Scripting(object):
    def __init__(self):
        super(Scripting,self).__init__()


    def setExpressionLanguage(self,languageNum):
        '''
        :param languageNum: 0 - hscript, 1 - python
        :return:
        '''
        if languageNum==0 or languageNum =='hscript':
            hou.setPreference('scripting.exprlanguage.menu','hscript')
            # print('hscript')
        elif languageNum==1or languageNum =='python':
            hou.setPreference('scripting.exprlanguage.menu','python')
            # print('hscript')


    def setEditorTools_ParameterFields_SyntaxHighlighting(self,bool):
        if bool == True:
            hou.setPreference('ui.parm.syntax','1')
            # print('1')
        else:
            hou.setPreference('ui.parm.syntax','0')
            # print('0')


    def getEditorTools_ParameterFields_SyntaxHighlighting(self):
        return hou.getPreference('ui.parm.syntax')
        # print('getEditorTools_ParameterFields_SyntaxHighlighting')


    def setEditorTools_ParameterFields_ParenthesisAndQuoteMatching(self,bool):
        if bool == True:
            hou.setPreference('ui.parm.paren','1')
            # print('1')
        else:
            hou.setPreference('ui.parm.paren','0')
            # print('0')

    def getEditorTools_ParameterFields_ParenthesisAndQuoteMatching(self):
        return hou.getPreference('ui.parm.paren')
        # print('getEditorTools_ParameterFields_ParenthesisAndQuoteMatching')


    def setEditorTools_ParameterFields_ContextSensitivePopupHelp(self,bool):
        if bool == True:
            hou.setPreference('ui.parm.help','1')
            # print('1')
        else:
            hou.setPreference('ui.parm.help','0')
            # print('0')


    def getEditorTools_ParameterFields_ContextSensitivePopupHelp(self):
        return hou.getPreference('ui.parm.help')
        # print('getEditorTools_ParameterFields_ContextSensitivePopupHelp')



    def setEditorTools_TextEditors_SyntaxHighlighting(self,bool):
        if bool == True:
            hou.setPreference('ui.editor.syntax','1')
            # print('1')
        else:
            hou.setPreference('ui.editor.syntax','0')
            # print('0')

    def getEditorTools_TextEditors_SyntaxHighlighting(self):
        return hou.getPreference('ui.editor.syntax')
        # print('getEditorTools_TextEditors_SyntaxHighlighting')



    def setEditorTools_TextEditors_ParenthesisAndQuoteMatching(self,bool):
        if bool == True:
            hou.setPreference('ui.editor.paren','1')
            # print('1')
        else:
            hou.setPreference('ui.editor.paren','0')
            # print('0')


    def getEditorTools_TextEditors_ParenthesisAndQuoteMatching(self):
        return hou.getPreference('ui.editor.paren')
        # print('getEditorTools_TextEditors_ParenthesisAndQuoteMatching')



    def setEditorTools_TextEditors_EditorToolbar(self,bool):
        if bool == True:
            hou.setPreference('ui.editor.toolbar','1')
            # print('1')
        else:
            hou.setPreference('ui.editor.toolbar','0')
            # print('0')


    def getEditorTools_TextEditors_EditorToolbar(self):
       return hou.getPreference('ui.editor.toolbar')
        # print('getEditorTools_TextEditors_EditorToolbar')


    def setEditorTools_Textport_SyntaxHighlighting(self,bool):
        if bool == True:
            hou.setPreference('ui.textport.syntax','1')
            # print('1')
        else:
            hou.setPreference('ui.textport.syntax','0')
            # print('0')

    def getEditorTools_Textport_SyntaxHighlighting(self):
        return hou.getPreference('ui.textport.syntax')
        # print('getEditorTools_Textport_SyntaxHighlighting')



    def setEditorTools_Textport_ParenthesisAndQuoteMatching(self,bool):
        if bool == True:
            hou.setPreference('ui.textport.paren','1')
            # print('1')
        else:
            hou.setPreference('ui.textport.paren','0')
            # print('0')

    def getEditorTools_Textport_ParenthesisAndQuoteMatching(self):
        return hou.getPreference('ui.textport.paren')
        # print('getEditorTools_Textport_ParenthesisAndQuoteMatching')



    def setEditorTools_Textport_ContextSensitivePopupHelp(self,bool):
        if bool == True:
            hou.setPreference('ui.textport.help','1')
            # print('1')
        else:
            hou.setPreference('ui.textport.paren','0')
            # print('0')

    def getEditorTools_Textport_ContextSensitivePopupHelp(self):
        return hou.getPreference('ui.textport.help')
        # print('getEditorTools_Textport_ContextSensitivePopupHelp')